<?php
/*
    GUMUD is Extensible Web-based Multi-User Dungeon Software.

    Copyright (C) 2013  White Rabbit

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$xtpl->assign('left', $itx['block']['mod']['left']);
$xtpl->assign('right', $itx['block']['mod']['right']);
$xtpl->assign('center', $itx['block']['mod']['center']);
$xtpl->assign('copyright', $itx['block']['mod']['copyright']);
$xtpl->assign('header', $itx['block']['mod']['header']);
$xtpl->assign('top', $itx['block']['mod']['top']);
$xtpl->assign('search', $itx['block']['mod']['search']);
$xtpl->assign('user1', $itx['block']['mod']['user1']);
$xtpl->assign('user2', $itx['block']['mod']['user2']);
$xtpl->assign('user3', $itx['block']['mod']['user3']);
$xtpl->assign('user4', $itx['block']['mod']['user4']);
$xtpl->assign('user5', $itx['block']['mod']['user5']);
$xtpl->assign('user6', $itx['block']['mod']['user6']);
$xtpl->assign('user7', $itx['block']['mod']['user7']);
$xtpl->assign('user8', $itx['block']['mod']['user8']);
$xtpl->assign('user9', $itx['block']['mod']['user9']);
$xtpl->assign('user10', $itx['block']['mod']['user10']);
if (isset($itx['page']['meta']['desc']) AND $itx['page']['meta']['desc'] != NULL) {
$xtpl->assign('metadesc', $itx['page']['meta']['desc']);
}
else {
$xtpl->assign('metadesc', defaultMetaDesc);
}
if (isset($itx['page']['meta']['key'])) {
$xtpl->assign('metakey', $itx['page']['meta']['key'].defaultMetaKey);
}
else {
$xtpl->assign('metakey', defaultMetaKey);
}
$xtpl->assign('sitename', defaultSiteName);
$xtpl->assign('sitemotto', defaultSiteMotto);
if ((isset($_SESSION['sysmessage'])) AND ($_SESSION['sysmessage'] != NULL)) {
$xtpl->assign('sysmessage', $_SESSION['sysmessage']);
}
if ((isset($_SESSION['error'])) AND ($_SESSION['error'] != NULL)) {
$xtpl->assign('error', $_SESSION['error']);
}
$_SESSION['sysmessage'] = NULL;
$_SESSION['error'] = NULL;
$xtpl->assign('css',defaultCSS);
$xtpl->assign('pagename', $itx['page']['name']);
//assign component
$xtpl->assign('com', $itx['block']['com']);
//process and output to screen
$itx['panelmenu'] = FALSE;
if (preg_match("/class=\"MenuBarVertical\"/",$itx['block']['mod']['left'].$itx['block']['mod']['right'])) {
$xtpl->parse("main.menu1");
$xtpl->parse("main.panelmenu.menu2");
$itx['panelmenu'] = TRUE;
}
if (preg_match("/class=\"TabbedPanels\"/",$itx['block']['com'])) {
$xtpl->parse("main.panels1");
$xtpl->parse("main.panelmenu.panels2");
$itx['panelmenu'] = TRUE;
}
if ($itx['panelmenu'] == TRUE) {
$xtpl->parse("main.panelmenu");
}
$xtpl->parse('main');
$xtpl->out('main');
?>
